﻿// ***********************************************************************
// Assembly         : YERIL_PI_INT
// Author           : Diego Bonilla
// Created          : 03-02-2014
//
// Last Modified By : Diego Bonilla
// Last Modified On : 03-02-2014
// ***********************************************************************
// <copyright file="Home.aspx.cs" company="Development Solutions CR">
//     Copyright (c) Development Solutions CR. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// The Principal namespace.
/// </summary>
namespace YERIL_PI_INT.PaginasWebs.Modulos.Principal
{
    /// <summary>
    /// Class Home.
    /// </summary>
    public partial class Home : System.Web.UI.Page
    {
        /// <summary>
        /// The URL contenido
        /// </summary>
        public string UrlContenido = "";
        /// <summary>
        /// The usu_nombre
        /// </summary>
        public static string usu_nombre = "";
        /// <summary>
        /// The usu_puesto
        /// </summary>
        public static int usu_puesto = 0;
        /// <summary>
        /// The usu_codusuario
        /// </summary>
        public static int usu_codusuario = 0;
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                

                if (Session["Nombre_Usuario"] != null)
                {
                    usu_nombre = Session["Nombre_Usuario"].ToString();
                    lblUsuario.Text = usu_nombre;
                }
                else
                {
                    Response.Redirect("Default.aspx");
                }

                if (Session["Codigo_Usuario"] != null)
                {
                    usu_codusuario =Convert.ToInt32( Session["Codigo_Usuario"]);
                  
                }
                else
                {
                    Response.Redirect("Default.aspx");
                }

                if (Session["Puesto"] != null)
                {
                    usu_puesto =Convert.ToInt32(Session["Puesto"]);

                }
                else
                {
                    Response.Redirect("Default.aspx");
                }

                UrlContenido = "DashBoard.aspx" + "?codigo_usuario=" + usu_codusuario + "&puesto=" + usu_puesto;
            }
        }


        /// <summary>
        /// Handles the Click event of the lkbDashBoards control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void lkbDashBoards_Click(object sender, EventArgs e)
        {
            Response.Redirect("Home.aspx");
        }

        protected void lkbReportes_Click(object sender, EventArgs e)
        {
            UrlContenido = "I_REPT_TOT_PROY_BY_CLIENTE.aspx";
        }

        

       

        

    }
}